<template>
  <div>
    <el-table :data="tableList">
      <el-table-column label="用户信息" align="center">
        <template slot-scope="scope">
          <img :src="scope.row.headimgurl" alt width="70" height="70" style="border-radius:50%;"/>
          <span style="margin-left: 10px">用户名称：{{ scope.row.nickname }}</span>
        </template>
      </el-table-column>
      <el-table-column label="用户手机号" prop="mobile" align="center"></el-table-column>
      <el-table-column label="充值时间" prop="payAt" align="center"></el-table-column>
      <el-table-column label="充值金额" prop="payMoney" align="center"></el-table-column>
      <el-table-column label="充值操作" prop="prodName" align="center"></el-table-column>
      <el-table-column label="充值状态" align="center">
        <template slot-scope="scope">
          <!-- <el-button type="primary" @click="scope.row.status">查看充值列表</el-button> -->
          <span>{{scope.row.status == 1 ?'已支付' :scope.row.status == 0 ?'未支付' :scope.row.status == -1 ?'支付失败' :'取消订单'}}</span>
        </template>
      </el-table-column>
    </el-table>
    <el-pagination
      background
      layout="prev, pager, next"
      :current-page.sync="currentPage"
      style="text-align:center;margin-top:20px;"
      :total="total"
    ></el-pagination>
  </div>
</template>
<script>
import { getPay } from "@/api/member";
export default {
  data() {
    return {
      currentPage: 1,
      total: "",
      tableList: []
    };
  },
  watch: {
    currentPage(val) {
      this.getData(val);
    }
  },
  methods: {
    getData(page) {
      getPay({ page: page }).then(res => {
        this.total = res.data.data.total;
        this.tableList = res.data.data.data;
      });
    }
  },
  mounted() {
    this.getData(1);
  }
};
</script>
<style>
</style>
